package easycloud.ecs.provider.api;

import java.io.InputStream;
import java.net.URL;
import java.util.List;

import easycloud.ecs.common.domain.Folder;
import easycloud.ecs.common.domain.Item;
import easycloud.ecs.provider.model.IStorageObject;
import easycloud.ecs.provider.model.IStorageObjectMetadata;
import easycloud.ecs.provider.service.SendLogService;

public interface IProvider {

	/**
	 * @param item
	 * @throws ProviderException
	 */
	boolean delete(Item item) throws ProviderException;

	/**
	 * 
	 * @param item
	 * @return
	 */
	URL getAccessURL(Item item);

	/**
	 * 
	 * @param item
	 * @return
	 * @throws ProviderException
	 */
	IStorageObject getItem(Item item) throws ProviderException;

	/**
	 * 
	 * @return
	 */
	String getName();

	/**
	 * 
	 * @param item
	 * @return
	 * @throws ProviderException
	 */
	IStorageObjectMetadata head(Item item) throws ProviderException;

	/**
	 * 
	 * @param folder
	 * @return
	 * @throws ProviderException
	 */
	List<IStorageObjectMetadata> list(Folder folder) throws ProviderException;

	/**
	 * 
	 * @param item
	 * @param is
	 * @param length
	 * @return
	 * @throws ProviderException
	 */
	IStorageObjectMetadata putItem(Item item, InputStream is, long length)
			throws ProviderException;

	/**
	 * 
	 * @return
	 */
	boolean ready();

	/**
	 * 
	 * @param sendLogService
	 */
	void setSendLogService(SendLogService sendLogService);

}
